<template>
  <div class="basic-from" v-dialogDrag>
    <el-dialog
      custom-class="small-padding-dialog"
      :close-on-click-modal="false"
      :title="dialogTitle"
      :visible.sync="dialogVisible"
      width="70%"
      @close="handleClosed"
    >
      <div class="card-title" >隔离点信息</div>
      <HotelInfo :formData="formData" />
      <div class="card-title" >预订信息</div>
      <reserveInfo :formData="formData"/>
      <div class="card-title" >转运人员明细</div>
      <transferInfo :formData="formData"/>
      <div class="card-title" >接收信息</div>
      <receiveInfo :formData="formData"/>
    </el-dialog>
  </div>
</template>

<script>
import HotelInfo from "../hotelReserve/components/hotelInfo.vue";
import reserveInfo from "./components/reserveInfo.vue";
export default {
  name: "hotelDialog",
  inject: ["initList"],
  components: {
    HotelInfo,
    reserveInfo,
  },
  data() {
    return {
      //弹窗类型，默认新增
      type: "preview",
      dialogTitle: "隔离点信息",
      //选中的物业
      radioId: "",
      //弹窗开关
      dialogVisible: false,
      // 表单项
      formData: {},
    };
  },
  computed: {},
  methods: {
    //开启弹窗,请求数据
    async show({ type, data = {} }) {
      console.log(data);
      this.dialogTitle = type == "preview" ? "隔离点信息" : "隔离点登记";
      // 请求接口拿到详细数据
      // const res = await this.http(`/api/repairbill/${data.billId}`)
      this.type = type;
      this.dialogVisible = true;
      this.formData = data;
    },
    // 弹窗关闭还原
    handleClosed() {
      this.uploadFileList = [];
      let _formData = JSON.parse(JSON.stringify(this.formData));
      let _approvalForm = JSON.parse(JSON.stringify(this.approvalForm));
      for (let i in _formData) {
        _formData[i] = "";
      }
      for (let i in _approvalForm) {
        _approvalForm[i] = "";
      }
      this.formData = _formData;
      this.approvalForm = _approvalForm;
      this.approvalList = [];
      this.$refs.dialogForm.resetFields();
    },
  },
};
</script>

<style lang="scss" scoped>
.addDialog {
  /deep/ .el-date-editor--datetime {
    width: 100%;
  }
  .album {
    .el-col {
      margin-bottom: 20px;
    }
    .img {
      width: 100%;
      height: 200px;
    }
  }
}
</style>
